<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
    <script src="js/alert.js"></script>
    <title>充值明细</title>
    <style type="text/css">
        #data{
            padding: 0 5% 0 5%;
        }
        .bean{
            border-bottom: 1px solid #d4d4d4;
            height: 4.8em;
            padding-top: 1em;
        }

    </style>

</head>

<body>

<div id="data">

</div>

</body>
<script src="js/jquery.min.js"></script>
<script type="">
    $(document).ready(function () {
        getdata()
    });

    function getdata(){
        $.ajax({
            "url": "/vip/recharge/",
            "type": "POST",
            "dataType": "json",
            "success": function (json) {
                $("#data").empty();
                var list = json.data;

                for (var i = 0; i < list.length; i++) {
                    if ("0" !== list[i].price) {
                        var html = '<div class="bean">'+
                            '<div style="padding-bottom: 2.5em;">'+
                            '<div style="text-align: left;float: left;width: 70%;font-size: 1.2em;">#{DOCNO}</div>'+
                            '<div style="text-align: right;float: left;width: 30%;font-size: 1.2em;color: #{COLOR}">#{VIP_PAYAMT}</div>'+
                            '</div>'+
                            '<div>'+
                            '<div style="text-align: left;width: 30%;float: left;color: #979797;font-size: 0.9em;">#{TYPE}</div>'+
                            '<div style="text-align: right;width: 70%;float: left;color: #979797;font-size: 0.9em;">#{BILLDATE}</div>'+
                            '</div>'+
                            '</div>';

                        html = html.replace("#{BILLDATE}", list[i].date);
                        html = html.replace("#{DOCNO}", list[i].store);
                        html = html.replace("#{VIP_PAYAMT}", list[i].price.replace("-",""));
                        html = html.replace("#{TYPE}",Number(list[i].price)>0?"充值":"消费");
                        html = html.replace("#{COLOR}",Number(list[i].price)>0?"green":"red");
                        $("#data").append(html);
                    }
                }
            }
        })
    }

</script>
</html>